import { initExecute } from '../../utils/index.js';
class BaseTan {
	constructor(instance, ActionButtons) {
		this.instance = instance;
		this.ActionButtons = ActionButtons;
		this.exec = initExecute.call(this);
	}
	static initInstance(instance) {
		return (method, ...args) => {
			if (method) {
				if (typeof method === 'string') {
					instance[method](...args);
				} else {
					instance.open(method, ...args);
				}
			} else {
				return instance;
			}
		};
	}
	// --------------------------------------
	onClick(ctx, fn, close) {
		return () => fn ? fn.call(ctx, close) : close();
	}
}
export default BaseTan;